function form_submit(){
	var username = $("#username").val();
	var password = $("#password").val();
	var validateCode = $("#validateCode").val();
	if (username == "") {
		$.messager.alert("系统提示", "用户名不能为空!", "warning", function() {
			$("#username").focus();
		});
		return;
	}
	if (password == "") {
		$.messager.alert("系统提示", "密码不能为空!", "warning", function() {
			$("#password").focus();
		});
		return;
	}
	if (validateCode == "") {
		$.messager.alert("系统提示", "验证码不能为空!", "warning", function() {
			$("#validateCode").focus();
		});

		return;
	}
	document.getElementById("login").submit();
}
function form_reset(){
	document.getElementById("login").reset();
}
function reloadcode(url){
    var verify=document.getElementById('safecode');
    verify.setAttribute('src',url+'admin/code.htm?'+Math.random());
}
$(function(e){
	$('input:text').bind('keydown', function (e) {
        var key = e.which;
        if (key == 13) {
        	form_submit();
        }

    });
});